using System;
using System.Collections.Generic;
using Yama.HelloWorld.Models;
using Yama.MVC.NHibernate.Connections;
using Yama.MVC.NHibernate.Repositories;

namespace Yama.HelloWorld.Dao.NHibernate
{
    public class VisitDao:GenericDao<int,Visit>, IVisitDao
    {
        public VisitDao(ISessionProvider provider) : base(provider)
        {
        }

        #region Implementation of IVisitDao

        public long CountVisitsForUrl(string url)
        {
            return Count(new Dictionary<string, object>
                             {
                                 {"Url", url}
                             });
        }

        #endregion
    }
}